﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pink.Scheduler.DataAccess.MetadataInfo
{
	/// <summary>
	/// Описание проперти в мапинге.
	/// </summary>
	public class Property
	{
		/// <summary>
		/// Конструктор
		/// </summary>
		/// <param name="name"></param>
		/// <param name="column"></param>
		/// <param name="type"></param>
		/// <param name="length"></param>
		/// <param name="notNull"></param>
		public Property(string name, string column, Type type, int? length, bool notNull)
		{
			this.PropertyName = name;
			this.ColumnName = column;
			this.Type = type;
			this.Length = length;
			this.NotNull = notNull;
		}

		/// <summary>
		/// Имя свойства
		/// </summary>
		public readonly string PropertyName;
		/// <summary>
		/// Название колонки
		/// </summary>
		public readonly string ColumnName;
		/// <summary>
		/// Тип проверти
		/// </summary>
		public readonly Type Type;
		/// <summary>
		/// Максимальаня длинна
		/// </summary>
		public readonly int? Length;
		/// <summary>
		/// Возможно ли пустое значение
		/// </summary>
		public readonly bool NotNull;
	}

	/// <summary>
	/// Класс
	/// </summary>
	public class Class
	{
		/// <summary>
		/// Коснтруктор
		/// </summary>
		/// <param name="name"></param>
		/// <param name="table"></param>
		public Class(string name, string table)
		{
			this.ClassName = name;
			this.TableName = table;
		}

		/// <summary>
		/// Имя класса
		/// </summary>
		public readonly string ClassName;
		/// <summary>
		/// Имя таблицы
		/// </summary>
		public readonly string TableName;

		/// <summary>
		/// Индексатор свойств
		/// </summary>
		/// <param name="propertyName"></param>
		/// <returns></returns>
		public virtual Property this[string propertyName]
		{
			get { return null; }
		}
	}
}
